<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<LINK href="<?=$this->styleurl?>/images/index.css" type=text/css rel=stylesheet />
</head>

<body>
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0 
            CALLPADDING="0">
              <TBODY>
			                <TR BORDER="0" WIDTH="100%">
                <TD style="PADDING-LEFT: 8px; PADDING-TOP: 8px" vAlign=top 
                align=left width="100%" bgColor=#ffffff height=30>
				<table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="85%"><img src="<?=$this->styleurl?>/images/url_01.gif" width="7" height="10" />&nbsp;<strong>添加博文分类</strong></td>
                    <td width="15%">&nbsp;</td>
                  </tr>
                </table>				 </TD>
              </TR>
<?php 			  
if($this->action == 'add')
{
?>
<form id="form1" name="form1" method="post" action="<?=$this->adminurl?>/class/submitclass">
			<TR BORDER="0" WIDTH="100%">
			                  <TD height="30"><span style="PADDING-LEFT: 8px; PADDING-TOP: 8px">名　称：
                                  <input name="class_name" type="text" id="class_name" size="50" />
			                  </span></TD>
                    </TR>
			  <TR BORDER="0" WIDTH="100%">
                <TD style="PADDING-LEFT: 8px; PADDING-TOP: 8px" vAlign=top 
                align=left bgColor=#ffffff height=30>
			  <p style="background:#F0F0F0">&nbsp;上 级 栏 目：                  
                  <select name="fid" id="fid">
                    <option value="0" selected="selected">顶级栏目</option>
                    <?php foreach ($this->class_list as $row):?>
                    <option value="<?=$row["class_id"]?>"><?=$row["class_name"]?></option>
                    <?php endforeach;?>
                  </select>&nbsp;专 题 类 别：
                  <select name="top_id" id="top_id">
                    <?php foreach ($this->topic_list as $row):?>
                    <option value="<?=$row["top_id"]?>"><?=$row["top_name"]?></option>
                    <?php endforeach;?>
                  </select>&nbsp;是否首页显示:
                  <select name="class_if_show">
                    <option value="1" selected>是</option>
 					<option value="0">否</option>
                  </select>
                  </p>
                  </TD>
              </TR>
			<TR BORDER="0" WIDTH="100%">
                <TD style="PADDING-LEFT: 8px; PADDING-TOP: 8px" vAlign=top 
                align=left bgColor=#ffffff height=30><span class="help">
                  <input type="image" src="<?=$this->styleurl?>/images/submit.gif" align="absmiddle" border="0" 
                        name="submit" onclick="return checkform(this.form)" />
                  <input name="action" type="hidden" id="action" value="add" />
                </span></TD>
              </TR>
 </form>
 <script language="javascript">
function checkform(theform)
{
if(theform.class_name.value=="")
  {
  alert("请输入栏目名称！");
  theform.class_name.focus();
  return false;
  }
return true;
}
</script>
 <?php 
 }
if($this->action == 'edit'){
	//var_dump($this->class_list);exit;
 ?>
 <form id="form1" name="form1" method="post" action="<?=$this->adminurl?>/class/submitclass">
			<TR BORDER="0" WIDTH="100%">
			                  <TD height="30"><span style="PADDING-LEFT: 8px; PADDING-TOP: 8px">名　称：
                                  <input name="class_name" type="text" id="class_name" size="50" value="<?=$this->class_info["class_name"]?>"/>
			                  </span></TD>
                    </TR>
			  <TR BORDER="0" WIDTH="100%">
                <TD style="PADDING-LEFT: 8px; PADDING-TOP: 8px" vAlign=top 
                align=left bgColor=#ffffff height=30>
			  <p style="background:#F0F0F0">上 级 栏 目：                  
                  <select name="fid" id="fid">
                    <option value="0">顶级栏目</option>
                    <?php foreach ($this->class_list as $row):?>
                    <option value="<?=$row["class_id"]?>" <?php if($this->class_info["class_fid"] == $row["class_id"]){echo 'selected';}?>><?=$row["class_name"]?></option>
                    <?php endforeach;?>
                  </select>专 题 类 别：
                  <select name="top_id" id="top_id">
                    <?php foreach ($this->topic_list as $row):?>
                    <option value="<?=$row["top_id"]?>" <?php if($this->class_info["class_top"] == $row["top_id"]){echo 'selected';}?>><?=$row["top_name"]?></option>
                    <?php endforeach;?>
                  </select>&nbsp;是否首页显示:
                  <select name="class_if_show">
                    <option value="1" <?php if($this->class_info["class_if_show"]==1)echo "selected";?>>是</option>
 					<option value="0" <?php if($this->class_info["class_if_show"]==0)echo "selected";?>>否</option>
                  </select>
                  </p>
                  </TD>
              </TR>
			<TR BORDER="0" WIDTH="100%">
                <TD style="PADDING-LEFT: 8px; PADDING-TOP: 8px" vAlign=top 
                align=left bgColor=#ffffff height=30><span class="help">
                  <input type="image" src="<?=$this->styleurl?>/images/submit.gif" align="absmiddle" border="0" 
                        name="submit" onclick="return checkform(this.form)" />
                  <input name="action" type="hidden" id="action" value="edit" />
                  <input name="id" type="hidden" id="id" value="<?=$this->class_info["class_id"]?>" />
                </span></TD>
              </TR>
 </form>
  <script language="javascript">
function checkform(theform)
{
if(theform.class_name.value=="")
  {
  alert("请输入分类名称！");
  theform.class_name.focus();
  return false;
  }
return true;
}
</script>
 <?PHP 
}
 ?>
      </TABLE>
</BODY></HTML>